
package edu.gdkm.dao;

import edu.gdkm.pojo.Classinfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.Delete;

import java.util.List;

public interface ClassinfoXml {

    @Select("select * from tb_class where id=#{id}")
    public Classinfo findById(Integer id);

    @Select("select * from tb_class")
    public List<Classinfo> findAll();

    @Insert("insert into tb_class(classname) values(#{classname})")
    public boolean save(Classinfo classinfo);

    @Update("update tb_class set classname=#{classname} where id=#{id}")
    public boolean update(Classinfo classinfo);

    @Delete("delete from tb_class where id = #{id}")
    public boolean delete(Integer id);
}